#ifndef _MSG_QUEUE_H
#define _MSG_QUEUE_H

#include <pthread.h>
#include <amqp.h>
#define SEND_THREAD 6

struct thread_sndMsg {
	int qid;
	int time;
	int type;
};

struct msgbuf {
	long mtype;
	char mtext[50];
};

struct threadpool_t {
	pthread_mutex_t lock;
	pthread_mutex_t rabbit_lock;
	int qid;
	int channel;
    amqp_connection_state_t conn;
};

int create_queue(key_t key);
int send_to_queue(int qid, int type);
int recv_from_queue(int qid);
void send_loop(int qid, struct Config *config);
void *thread_send_msg(void *arg);
void *thread_recv_msg(void *arg);
#endif
